package org.Dao.imp;

import javax.persistence.Query;

import org.Dao.DlDao;
import org.hibernate.Session;
import org.hibernate.Transaction;



public class DlDaoImp implements DlDao{
	public Dlb validate(String xh,String kl)
	{
		try{
			Session session = org.util.HibernateSessionFactory.getSession();
			Transaction ts = session.beginTransaction();
			Query query = session.createQuery("from Dlb where xh=? and kl=?");
			query.setParameter(0, xh);
			query.setParameter(1, kl);
			query.setMaxResults(1);
			Dlb dlb=(Dlb)query.uniqueResult();
			if(dlb!=null){
				return dlb;
			}else{
				return null;
			}
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}

}
